const express = require('express');
const router = express.Router();
const {
  getAllComments,
  getCommentsByPostId,
  getCommentById,
  createComment,
  updateComment,
  deleteComment
} = require('../controllers/commentController');

// 评论路由
router.get('/comments', getAllComments);
router.get('/posts/:postId/comments', getCommentsByPostId);
router.get('/comments/:id', getCommentById);
router.post('/comments', createComment);
router.put('/comments/:id', updateComment);
router.delete('/comments/:id', deleteComment);

module.exports = router;